package com.jintoufs.domain.api.response;

import com.jhj.common.util.JhjStringUtil;

/**
 * 返回给应用的响应消息
 * 
 * @author fuhuo.zhang
 * @since 2015-03-17
 */
public class ApiResponse<T> {
    
    /**
     * 返回码 状态值：0表示成功；其它表示失败
     */
    private int code;
    
    /**
     * 结果说明
     */
    private String message;
    
    /**
     * 处理时间
     */
    private String timestamp;
    
    /**
     * 返回数据
     */
    private T data;
    
    public int getCode() {
        return code;
    }
    
    public void setCode(int code) {
        this.code = code;
    }
    
    public String getMessage() {
        return message;
    }
    
    public void setMessage(String message) {
        this.message = message;
    }
    
    public String getTimestamp() {
        return timestamp;
    }
    
    public void setTimestamp(String timestamp) {
        this.timestamp = timestamp;
    }
    
    public T getData() {
        return data;
    }
    
    public void setData(T data) {
        this.data = data;
    }
    
    public String toString() {
        return JhjStringUtil.beanObject2String(this);
    }
}
